#pragma once
#include "common_tool/factory.h"
#include "vehicle_dyn_base.hpp"
#include "vehicle_lateral_speed3dis.h"
#include "vehicle_lateral_speed.h"
#include "vehicle_lateral_speed_yaw.h"
#include "vehicle_linear_ll.h"
#include "vehicle_linear_4d4s.h"
#include "vehicle_lateral_tire.h"
#include "vehicle_vy_yaw_error3dis.h"

namespace auto_ros
{
namespace control
{
template <class derived>
VehicleDynBase *createVehicleDynDerived(std::string dyn_yaml_path_name)
{
	return new derived(dyn_yaml_path_name);
}
using vehicle_dyn_factory_type =
	auto_ros::common_tool::Factory<std::string, VehicleDynBase, VehicleDynBase *(*)(std::string dyn_yaml_path_name)>;
class VehicleDynFactory : public vehicle_dyn_factory_type
{
private:
	/* data */
public:
	VehicleDynFactory()
	{
		//Register("KfLateral", createKfDerived<KfLateral>);
		Register("VehicleLateralSpeed3dis", createVehicleDynDerived<VehicleLateralSpeed3dis>);
		Register("VehicleLateralSpeed", createVehicleDynDerived<VehicleLateralSpeed>);
		Register("VehicleLateralSpeedYaw", createVehicleDynDerived<VehicleLateralSpeedYaw>);
		Register("VehicleLinearLL", createVehicleDynDerived<VehicleLinearLL>);
		Register("VehicleLinear4d4s", createVehicleDynDerived<VehicleLinear4d4s>);
		Register("VehicleLateralTire", createVehicleDynDerived<VehicleLateralTire>);
		Register("VehicleVyYawError3dis", createVehicleDynDerived<VehicleVyYawError3dis>);
	}
};
} // namespace control
} // namespace auto_ros
